package org.adream.account.dao;

import java.util.List;

import org.adream.account.entity.SchoolEntity;
import org.adream.account.restful.vo.SchoolVO;
import org.apache.ibatis.annotations.Param;

@BaseMybatisDao
public interface SchoolDao {
	
	int addSchool(SchoolEntity school);
	
	int deleteSchool(SchoolEntity school);
	
	int updateSchool(SchoolEntity school);
	
	int updateSchoolByOriSid(@Param("school") SchoolEntity school,@Param("oriSid") String oriSid);
	
	List<SchoolEntity> querySchoolsByDr(@Param("dr") Integer dr);
	
	SchoolEntity querySchoolBySidAndDr(@Param("sid") String sid,@Param("dr") Integer dr);

	SchoolEntity querySchoolBySid(@Param("sid") String sid);
	
	List<SchoolEntity> querySchoolsBySnameAndDr(@Param("sname") String sname, @Param("dr") Integer dr);
	
	List<SchoolEntity> querySchoolsBySomeFields(@Param("sid") String sid,@Param("sname") String sname,@Param("schoolType")String schoolType,@Param("dr") Integer dr);

	int updateDirector(SchoolEntity school);
	
	SchoolEntity querySchoolByUidAndDr(@Param("uid") String uid, @Param("dr") int dr);
	
	//查询我认证梦想教师身份 所属的学校
	SchoolEntity queryMySchoolByUid(@Param("uid")String uid);
	
	//根据email,dr查询学校信息
	List<SchoolEntity> querySchoolsByEmailAndDr(@Param("email") String email, @Param("dr") Integer dr);
	
	List<SchoolVO> querySchoolsInfo(@Param("position")Integer position, @Param("count")Integer count,@Param("time")String time);
}